package com.example.demo2.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.demo2.common.Result;
import com.example.demo2.entity.AskKefu;
import com.example.demo2.entity.Customer;
import com.example.demo2.entity.DTO.AskKefuDTO;
import com.example.demo2.entity.Order;
import com.example.demo2.service.AskKefuService;
import com.example.demo2.service.CustomerService;
import com.example.demo2.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/echart")
public class EchartController {
    @Autowired
    private OrderService orderService;
  @GetMapping("orderInfo")
    public Result orderInfo(){
      HashMap<String, Object> map = new HashMap<>();
      map.put("x", CollUtil.newArrayList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"));
      map.put("y", CollUtil.newArrayList(150, 230, 224, 218, 135, 147, 260));
      return Result.success(map);
  }
  @GetMapping("orderInfo2")
    public Result orderInfo2(){
    return orderService.getData();
  }
}
